package com.lucky.carcodepro.common.annotation;

import java.lang.annotation.*;
import java.util.concurrent.TimeUnit;

/**
 * RepeatSubmit
 * <p>
 * 描述：防重复提交
 *
 * @author Annie
 * @version 2024/10/7 15:40
 */
@Inherited // 子类自动继承
@Documented
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface RepeatSubmit
{
    /**
     * 间隔时间(ms)，小于此时间视为重复提交
     */
    public int interval() default 5000;

    public TimeUnit timeUnit() default TimeUnit.MILLISECONDS;

    /**
     * 提示消息
     */
    public String message() default "不允许重复提交，请稍候再试";
}
